package top.buluoluo.userservice.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.buluoluo.commoncore.domain.response.Result;
import top.buluoluo.userservice.dto.request.testRequest;
import top.buluoluo.userservice.service.UserService;

@RestController
@RequestMapping("/admin")
@CrossOrigin(origins = "http://localhost:9999", allowCredentials = "true")
@Tag(name = "管理员功能管理", description = "管理员管理接口") // 为控制器添加标签和描述
public class AdminUserController {
    @Autowired
    private UserService userService;
    @Operation(summary = "强制用户所有设备下线接口", description = "接受userid，之后拉黑该userid对应的所有token")
    @PostMapping("/force-logout/{userId}")
    public Result<String> logout(@PathVariable Long userId) {
        return userService.forceLogoutUser(userId);
    }
}
